linux: Fix IRQ disable/enable logic across save/restore.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Tue, 10 Apr 2007 17:49:20 +0000 (18:49 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Tue, 10 Apr 2007 17:49:20 +0000 (18:49 +0100)
stop_machine_run() executes our callback function with interrupts
disabled.
Signed-off-by: Keir Fraser <keir@xensource.com>
linux-2.6-xen-sparse/drivers/xen/core/machine_reboot.c

index 5f2e8cdee42375c26ff2e18ffba8b45db68aeb1c..aa40702eed4c01471e4e90e17bc7233fa89b4593 100644 (file)
@@ -127,8 +127,10 @@ static int take_machine_down(void *p_fast_suspend)
        extern void time_resume(void);
 
        if (fast_suspend) {
-               preempt_disable();
+               BUG_ON(!irqs_disabled());
        } else {
+               BUG_ON(irqs_disabled());
+
                for (;;) {
                        err = smp_suspend();
                        if (err)
@@ -143,11 +145,11 @@ static int take_machine_down(void *p_fast_suspend)
                        preempt_enable();
                        xenbus_suspend_cancel();
                }
+
+               local_irq_disable();
        }
 
        mm_pin_all();
-       local_irq_disable();
-       preempt_enable();
        gnttab_suspend();
        pre_suspend();
 
@@ -178,7 +180,9 @@ static int take_machine_down(void *p_fast_suspend)
 #endif
        }
        time_resume();
-       local_irq_enable();
+
+       if (!fast_suspend)
+               local_irq_enable();
 
        return suspend_cancelled;
 }